package model

// Good represents the goods table
type Good struct {
	BaseModel
	Type   string  `gorm:"column:type;NOT NULL;type:ENUM('item', 'service')" json:"type"`
	Orders []Order `gorm:"foreignKey:GoodID" json:"orders"`
	Cart   []Cart  `gorm:"foreignKey:GoodID" json:"carts"`
}

// TableName sets the insert table name for this struct type
func (g *Good) TableName() string {
	return "goods"
}
